﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public class Doctor
    {
        private string surname;

        public string Surname
        {
            get { return surname; }
            set { surname = value; }
        }
        private int price;

        public int Price
        {
            get { return price; }
            set { price = value; }
        }
        private string time;

        public string Time
        {
            get { return time; }
            set { time = value; }
        }
        private string special;

        public string Special
        {
            get { return special; }
            set { special = value; }
        }

        public Doctor(string surname, int price, string time, string special) {
            Surname = surname;
            Price = price;
            Time = time;
            Special = special;
        
        }
    }



    public partial class _Default : System.Web.UI.Page
    {
        List<Doctor> newsList = new List<Doctor>();
      

       

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                newsList.Add(new Doctor("Ivanov", 200, "09:00-12:00", "Terapevt"));
                newsList.Add(new Doctor("Petrov", 300, "12:00-18:00", "Hirurg"));

                this.GridView1.DataSource = newsList;
                this.GridView1.DataBind();
            }
           
               
               
            
        }

        protected void repNews_ItemCommand(object source, RepeaterCommandEventArgs e)
        {


        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            newsList.Add(new Doctor(TextBox1.Text, Convert.ToInt32(TextBox2.Text), TextBox3.Text, TextBox4.Text));
            this.GridView1.DataSource = newsList;
            this.GridView1.DataBind();
            
            
        }
    }
}
